<?php
/**
*
* 功能描述（收货地址数据）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*/

class ModelAddress extends ModelBase
{
	function AddAddress($data)
	{
		$id = $this->db->Insert("user_address", $data);
		return $id;
	}

	function ModAddress($uid, $data, $id)
	{
		$cnt = $this->db->Update("user_address", $data, "id = $id and userid = $uid");
		return $cnt;
	}

	function DelAddress($uid, $id)
	{
		$cnt = $this->db->Delete("user_address", "id = $id and userid = $uid");
		return $cnt;
	}

	function GetList($id)
	{
		$data = $this->db->GetAll("user_address", "id, province, city, district, area ,address ,consignee ,mobile_to ,mobile_from", "userid = $id");
		return $data;
	}
}

